function varargout = filter_params(varargin)
% $Id: filter_params.m 320 2005-05-05 20:07:09Z odellj $
% FILTER_PARAMS Application M-file for filter_params.fig
%    FIG = FILTER_PARAMS launch filter_params GUI.
%    FILTER_PARAMS('callback_name', ...) invoke the named callback.

% Last Modified by GUIDE v2.0 18-Mar-2003 20:58:53
% $Log: filter_params.m,v $
% Revision 1.1.1.1  2004/02/18 20:09:49  odellj
% initial import into CVS
%
% Revision 1.2  2004/02/05 20:22:04  odellj
% Added Id and Log tags.
%

global hdr

if nargin == 0  % LAUNCH GUI

	fig = openfig(mfilename,'reuse');

	% Use system color scheme for figure:
	set(fig,'Color',get(0,'defaultUicontrolBackgroundColor'));

	% Generate a structure of handles to pass to callbacks, and store it. 
	handles = guihandles(fig);
    set(handles.hi_pass_str,'String',num2str(hdr.hi_pass));
    set(handles.low_pass_str,'String',num2str(hdr.low_pass));
	guidata(fig, handles);

	if nargout > 0
		varargout{1} = fig;
	end

elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK

	try
		if (nargout)
			[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
		else
			feval(varargin{:}); % FEVAL switchyard
		end
	catch
		disp(lasterr);
	end

end

% --------------------------------------------------------------------
function varargout = hi_pass_str_Callback(h, eventdata, handles, varargin)
global hdr

Value=get(h,'String');
disp(['setting hdr.hi_pass to ' Value])
hdr.hi_pass=str2num(Value);
set(handles.hi_pass_str,'String',num2str(hdr.hi_pass));
guidata(h, handles);

% --------------------------------------------------------------------
function varargout = low_pass_str_Callback(h, eventdata, handles, varargin)
global hdr

Value=get(h,'String');
hdr.low_pass=str2num(Value);
disp(['setting hdr.low_pass to ' Value])
set(handles.low_pass_str,'String',num2str(hdr.low_pass));
guidata(h, handles);

% --------------------------------------------------------------------
function varargout = done_Callback(h, eventdata, handles, varargin)
global hdr

% hdr.hi_pass=str2num(get(handles.hi_pass_str,'String'));
% hdr.low_pass=str2num(get(handles.low_pass_str,'String'));
disp('Setting hdr.hi & lo')
hdr.hi=sprintf('%02.0f',hdr.hi_pass);   % convert to string for generating file names
hdr.lo=sprintf('%02.0f',hdr.low_pass);

close
    